<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-touch-fullscreen" content="yes" />
	<meta name="format-detection" content="telephone=no,email=no" />
	<meta name="ML-Config" content="fullscreen=yes,preventMove=no" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<title>接受邀请</title>
	<meta name="keywords" content="" />
	<meta name="description" content="金果,邀请,页面" />
	<link type="text/css" rel="stylesheet" href="{$url_css}mobile/styles.css" />
	<script type="text/javascript" src="{$url_js}mobile/styleinterference.js"></script>
</head>

<body>
<div id="loading" class="loading up"><i></i></div>
<div class="wrap">
	<div class="login box">
		<img class="head" src="{$userinfo.HeadUrl}" alt="" />
		<p class="name">{$userinfo.UserNick}</p>
		<input type="hidden" name="userid" id="userid" value="{$userinfo.UserId}">
		<input type="text" name="mobile" id="mobile" value="" autofocus="" placeholder="请填写手机号" />
		<input class="code" type="text" name="code" id="code" value="" placeholder="请填写验证码" />
		<b id="INCODE" class="verification" style="line-height: 2.9em;">&nbsp;</b>
		<b id="INVITE" class="btnx">&nbsp;</b>
		<span class="dlogo">&nbsp;</span>
	</div>
</div>
<div class="modal" style="display: none;">
	<div class="getfruit">
		<div class="view">1个金果</div>
		<b class="close">&nbsp;</b>
		<a class="download" href="http://m.jinguonet.com/app/gold-default-release-v1.0.0.0.apk" title="">&nbsp;</a>
	</div>
</div>
<script type="text/javascript" src="{$url_js}mobile/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="{$url_js}mobile/default.js"></script>
{literal}
<script type="text/javascript">
    df.ready(function(){
        df.fullsize(42);
        var id = [$('#INCODE'),$('#INVITE'),$('.modal'),null];
        id[3] = id[2].find('.close');
        id[3].on('click',()=>{id[2].hide()});
        id[0].on('click',()=>{
            var mobile = $('#mobile').val();
            if (!mobile) {
                alert('请输入有效的手机号码');
                return false;
            }
            $.post('?do=SendMobileCode',{mobile:mobile},function (ret) {
			if (ret.code != 200) {
			    alert(ret.msg);
                return false;
            } else {
                id[0].html(60).css('background', '#fff');
                var clock = setInterval(function () {
					var time = parseInt(id[0].html());
					if (time > 1) {
					    time--;
					    id[0].html(time);
                    } else {
                        id[0].html(' ').css('background', '');
                        clearInterval(clock);
                    }
                }, 1000)
            }
        },'json');
    });
        id[1].on('click', function () {
            var mobile = $('#mobile').val();
            var userid = $('#userid').val();
            var code = $('#code').val();
            if (!code || !userid || !mobile) {
                alert('请填写手机号码与验证码');
                return false;
            }
            $.post('?do=AddInvite',{userid:userid,mobile:mobile,code:code},function (ret) {
                if (ret.code != 200) {
                    alert(ret.msg);
                    return false;
                } else {
                    id[2].show();
                }
            },'json');
        });
    });
</script>
{/literal}
</body>
</html>